const data = [];
for (let i = 0; i <= 360; i++) {
  let t = (i / 180) * Math.PI;
  let r = Math.sin(2 * t) * Math.cos(2 * t);
  data.push([r, i]);
}
const energyData = new Map()
energyData.set('01',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345", "34", "523"])
energyData.set('03',["234", "725", "342", "42", ])
energyData.set('04',["138", "242", "835", "126", "231", ])
energyData.set('05', ["443", "287", "765", "214", "532", "654", "134"])
energyData.set('06',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('07',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('08',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('09',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('10',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('11',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('12',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])
energyData.set('13',["230", "120", "467", "687", "345", "34", "523","230", "120", "467", "687", "345",])

export default {
  energyData: energyData,
  option1: {
    tooltip: {
      trigger: "item"
    },
    legend: {
      top: "5%",
      left: "center",
      itemGap: 1,
      textStyle: {
        fontSize: `12`
      }
    },
    series: [
      {
        name: "Access From",
        type: "pie",
        radius: ["40%", "70%"],
        avoidLabelOverlap: false,
        itemStyle: {
          borderRadius: 10,
          borderColor: "#fff",
          borderWidth: 2
        },
        label: {
          show: false,
          position: "center"
        },
        emphasis: {
          label: {
            show: true,
            fontSize: "40",
            fontWeight: "bold"
          }
        },
        labelLine: {
          show: false
        },
        data: [
          { value: 1048, name: "Search Engine" },
          { value: 735, name: "Direct" },
          { value: 580, name: "Email" },
          { value: 484, name: "Union Ads" }
        ]
      }
    ]
  },
  option2: {
    title: {
      text: ""
    },
    tooltip: {
      trigger: "axis"
    },
    legend: {
      data: ["Email", "Union Ads", "Video Ads", "Direct"]
    },
    grid: {
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: "category",
      boundaryGap: false,
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
      type: "value"
    },
    series: [
      {
        name: "Email",
        type: "line",
        stack: "Total",
        data: [120, 132, 101, 134, 90, 230, 210]
      },
      {
        name: "Union Ads",
        type: "line",
        stack: "Total",
        data: [220, 182, 191, 234, 290, 330, 310]
      },
      {
        name: "Video Ads",
        type: "line",
        stack: "Total",
        data: [150, 232, 201, 154, 190, 330, 410]
      },
      {
        name: "Direct",
        type: "line",
        stack: "Total",
        data: [320, 332, 301, 334, 390, 330, 320]
      }
    ]
  },
  option3: {
    title: {
      text: "Distribution of Electricity",
      subtext: "Fake Data"
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "cross"
      }
    },
    toolbox: {
      show: true,
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: "category",
      boundaryGap: false,
      // prettier-ignore
      data: ["00:00", "01:15", "02:30", "03:45", "05:00", "06:15", "07:30", "08:45", "10:00", "11:15", "12:30", "13:45", "15:00", "16:15", "17:30", "18:45", "20:00", "21:15", "22:30", "23:45"]
    },
    yAxis: {
      type: "value",
      axisLabel: {
        formatter: "{value} W"
      },
      axisPointer: {
        snap: true
      }
    },
    visualMap: {
      show: false,
      dimension: 0,
      pieces: [
        {
          lte: 6
        },
        {
          gt: 6,
          lte: 8
        },
        {
          gt: 8,
          lte: 14
        },
        {
          gt: 14,
          lte: 17
        },
        {
          gt: 17
        }
      ]
    },
    series: [
      {
        name: "Electricity",
        type: "line",
        smooth: true,
        // prettier-ignore
        data: [300, 280, 250, 260, 270, 300, 550, 500, 400, 390, 380, 390, 400, 500, 600, 750, 800, 700, 600, 400],
        markArea: {
          data: [
            [
              {
                name: "Morning Peak",
                xAxis: "07:30"
              },
              {
                xAxis: "10:00"
              }
            ],
            [
              {
                name: "Evening Peak",
                xAxis: "17:30"
              },
              {
                xAxis: "21:15"
              }
            ]
          ]
        }
      }
    ]
  },
  option4: {
    xAxis: {
      type: "category",
      boundaryGap: false,
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
      type: "value"
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: "line",
        areaStyle: {}
      }
    ]
  },
  option5: {
    legend: {
      data: ["Altitude (km) vs. temperature (°C)"]
    },
    tooltip: {
      trigger: "axis",
      formatter: "Temperature : <br/>{b}km : {c}°C"
    },
    grid: {
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    xAxis: {
      type: "value",
      axisLabel: {
        formatter: "{value} °C"
      }
    },
    yAxis: {
      type: "category",
      axisLine: { onZero: false },
      axisLabel: {
        formatter: "{value} km"
      },
      boundaryGap: false,
      data: ["0", "10", "20", "30", "40", "50", "60", "70", "80"]
    },
    series: [
      {
        name: "Altitude (km) vs. temperature (°C)",
        type: "line",
        symbolSize: 10,
        symbol: "circle",
        smooth: true,
        lineStyle: {
          width: 3,
          shadowColor: "rgba(0,0,0,0.3)",
          shadowBlur: 10,
          shadowOffsetY: 8
        },
        data: [15, -50, -56.5, -46.5, -22.1, -2.5, -27.7, -55.7, -76.5]
      }
    ]
  },
  option6: {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      },
      formatter: function(params) {
        // console.log(params);
      }
    },
    grid: {
      bottom: 20
    },
    legend: {
      data: ["bar1", "bar2", "bar3", "bar4"]
    },
    xAxis:
      {
        type: "category",
        axisTick: { show: false },
        data: ["系列1", "系列2", "系列3", "系列4"]
      },
    yAxis: [
      {
        type: "value"
      }
    ],
    series: [
      {
        name: "bar1",
        type: "bar",
        emphasis: {
          focus: "series"
        },
        stack: "a1",
        barGap: "0%", //将两根柱子合并 不是堆叠
        data: [320, 332, 301, 334]
      },
      {
        name: "bar1_1",
        type: "bar",
        emphasis: {
          focus: "series"
        },
        stack: "a1",
        barGap: "0%", //将两根柱子合并 不是堆叠
        data: [320, 332, 301, 334]
      },
      {
        name: "bar2",
        type: "bar",
        emphasis: {
          focus: "series"
        },
        barGap: "0%",
        data: [220, 182, 191, 234]
      },
      {
        name: "bar3",
        type: "bar",
        emphasis: {
          focus: "series"
        },
        data: [150, 232, 201, 154]
      },
      {
        name: "bar4",
        type: "bar",
        emphasis: {
          focus: "series"
        },
        data: [98, 77, 101, 99]
      }
    ]
  },
  option7: {
    xAxis: {
      type: "category",
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
      type: "value"
    },
    series: [
      {
        data: [120, 200, 150, 80, 70, 110, 130],
        type: "bar",
        showBackground: true,
        backgroundStyle: {
          color: "rgba(180, 180, 180, 0.2)"
        }
      }
    ]
  },
  option8: {
    legend: {
      top: "bottom"
    },
    toolbox: {
      show: true,
      feature: {
        mark: { show: true },
        dataView: { show: true, readOnly: false },
        restore: { show: true },
        saveAsImage: { show: true }
      }
    },
    series: [
      {
        name: "Nightingale Chart",
        type: "pie",
        radius: [50, 70],
        center: ["50%", "50%"],
        roseType: "area",
        itemStyle: {
          borderRadius: 8
        },
        data: [
          { value: 40, name: "rose 1" },
          { value: 38, name: "rose 2" },
          { value: 32, name: "rose 3" },
          { value: 30, name: "rose 4" },
          { value: 28, name: "rose 5" }
        ]
      }
    ]
  }

};
